<?php
namespace app\home\model;
use think\Model;
class Seo extends Model
{
    protected $pd = 'id';
    protected $schema = [
        'id'            => 'int',
        'key'           => 'string',
        'value'         => 'string',
    ];
    public static function getFriendLink()
    {
        return self::where('key','fd')->select();
    }
    public static function getKeywords()
    {
        $kws = self::where('key','kw')->select();
        $str = '';
        foreach($kws as $index => $kw){
            $str .= $kw['value'];
            if($index+1 != count($kws)){
                $str .= ', ';
            }
        }
        return $str;
    }
    public static function getTitle()
    {
        return self::where('key','host')->find()->value;
    }
    public static function getDesc()
    {
        return self::where('key','desc')->find()->value;
    }
}